package com.example.a10928.weifriend.http.configuration;

import android.widget.Toast;

import com.example.a10928.weifriend.util.L;


public class CodeErrorShowException {



    public static void show(int code,String msg) {
        switch (code) {

            case ApiException.CODE_OPERATION_FAILURE:
                t(msg);
                break;
/*            case ApiException.CODE_NO_TOKEN:
                t("缺少token");
                break;
            case ApiException.CODE_TOKEN_ERROR:
                t("token不正确,用户未登录");
                break;
            case ApiException.CODE_TOKEN_PAST_DUE:
                t("token已过期,请重新登录");
                break;*/
            case ApiException.CODE_PARAMETER_ERROR:
                t(msg);
                break;
            case ApiException.CODE_ACCOUNT_PASSWORD_ERROR:
                t("账号或密码不正确");
                break;
            case ApiException.CODE_PHONE_UNREGISTERED:
                t("该手机号未注册,请重新输入");
                break;
            case ApiException.CODE_PHONE_REGISTERED:
                t("该手机号已被注册");
                break;
            case ApiException.CODE_ENTERED_PASSWORDS_DIFFER:
                t("两次密码不一致");
                break;
            case ApiException.CODE_NAME_ALREADY_EXISTS:
                t("昵称已被占用");
                break;
            case ApiException.CODE_CODE_ERROR:
                t("验证码错误");
                break;
            case ApiException.CODE_CODE_PAST_DUE:
                t("验证码过期");
                break;
            case ApiException.CODE_CODE_REPETITION:
                t("验证码重复发送");
                break;
            case ApiException.CODE_PASSWORD_ERROR:
                t("密码错误");
                break;
            case ApiException.CODE_MAIL_ALREADY_EXISTS:
                t("邮箱已被使用");
                break;
            case ApiException.CODE_IDENTITY_CARD_ALREADY_EXISTS:
                t("该身份证已被认证");
                break;
            case ApiException.CODE_PICTURE_FORMAT_ERROR:
                t("图片大小或格式不正确");
                break;
            case ApiException.CODE_PICTURE_BIG:
                t("图片大小不得高于3M");
                break;
            case ApiException.CODE_BANK_NUM_INCORRECT:
                t("银行卡号码不规范");
                break;
            case ApiException.CODE_BANK_INCORRECT:
                t("银行名有误");
                break;
            case ApiException.CODE_PAY_PASSWORD_NOT_SET:
                t("没有设置资金密码，跳转到资金密码设置界面");
                break;
            case ApiException.CODE_AFTER_15:
                t("下单后15分钟才可确认");
                break;
            case ApiException.CODE_1032:
                t("完成初级认证和高级认证后，才能交易");
                break;
            case ApiException.CODE_TOKEN_PAST_DUE:
                t("登录失效，重新登录");
                break;
            case ApiException.CODE_TOKEN_ERROR:
                t("登录失效，重新登录");
                break;
            case ApiException.CODE_NO_TOKEN:
                t("登录失效，重新登录");
                break;
            case ApiException.BLACK_LIST:
                t("登录失效，重新登录");
                break;
            case ApiException.CODE_OTHER_LOGIN:
                t("登录失效，重新登录");
                break;
            case ApiException.CODE_PLEASE_PRIMARY_AUTH:
                t("完成高级认证，才能交易");
                break;
            case ApiException.CODE_WAIT:
                t("已将订单入库等待匹配!");
                break;
            default:
                t(msg);
                break;
        }
    }


    public static void t(String msg){
        L.t(msg);
    }

}
